package com.example.xuanke.mapper;

import com.example.xuanke.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper {

    @Select("select * from admin where username=#{username} and pwd=#{pwd}")
    Boolean isExist(String username, String pwd);

    @Select("select * from admin where username=#{username}")
    User findByUsername(String username);

    @Select("select * from admin where username=#{username}")
    int find(String username);

    @Insert("insert into admin (username,pwd) values(#{username},#{pwd})")
    void register(String username, String password);
}
